using UnityEngine;

public class InterfaceUI : MonoBehaviour
{
	private GameObject uiobj;

	public UIEventListener closebtn;

	public UIWidget contain1;

	public UIWidget contain2;

	private void Start()
	{
		closebtn.onClick = OnClickcloseBtn;
	}

	public void OnClickcloseBtn(GameObject btn)
	{
		MonoInstance<AudioController>.instance.play(AudioType.UI_BTN, 0f);
		if (contain2.alpha == 1f)
		{
			disable();
			return;
		}
		contain1.alpha = 0f;
		contain1.gameObject.SetActive(false);
		contain2.alpha = 1f;
		contain2.gameObject.SetActive(true);
	}

	public void init_ui_info()
	{
		Time.timeScale = 0f;
		contain1.alpha = 1f; contain1.gameObject.SetActive(true);
		contain2.alpha = 0f; contain2.gameObject.SetActive(false);
		Platform.HideFeatureView();
	}

	public void enable()
	{
		if (uiobj == null)
		{
			uiobj = base.gameObject;
		}
		NGUITools.SetActive(uiobj, state: true);
		init_ui_info();
	}

	public void disable()
	{
		NGUITools.SetActive(uiobj, state: false);
		gamebackctl.instance.BackGameUIstate();
		if (gamebackctl.instance.curstate == GameUIState.normal)
		{
			Time.timeScale = 1f;
		}
		else
		{
			Platform.ShowFeatureView();
		}
	}
}
